#ifndef __COMPONENT_H
#define __COMPONENT_H


typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;


#define BIT_SET(par, p)     ((par) |= (1 << (p)))
#define BIT_CLEAR(par, p)   ((par) &= ~(1 << (p)))
#define BIT_GET(par, p)     (((par) >> (p)) & 0x01)
#define BIT_WRITE(par, bit, val)    do{\
                                        if (val != 0) {\
                                            BIT_SET(par, bit);\
                                        }\
                                        else {\
                                            BIT_CLEAR(par, bit);\
                                        }\
                                    }while(0);


#define ABS(x)  (x >= 0 ? x : -x)


void my_memcpy(void* tar, const void* src, unsigned int len);
void my_memset(char* buf, char val, unsigned int len);


#endif

